<template>
  <div class="goos">
    <HomeHeader />
    <HeaderSearch />
    <Nav />
    <!-- 如果不是视频则进普通商品组件，如果是视频则进视频组件 -->
    <GoodsInfo v-if="isVideo!=='视频'"></GoodsInfo>
    <DecoratVideo v-else></DecoratVideo>
    <HomeFooter></HomeFooter>
  </div>
</template>

<script>
import HomeHeader from '@/views/homePage/homeHeader'
import HeaderSearch from '@/views/homePage/headerSearch'
import Nav from '@/views/homePage/navji'
import GoodsInfo from '../goodsInfo'
import DecoratVideo from '../decoratVideo'
import HomeFooter from '@/views/homePage/homeFooter'

export default {
  name: "goods",
  components: {
    HomeHeader,
    HeaderSearch,
    Nav,
    GoodsInfo,
    DecoratVideo,
    HomeFooter,
  },
  data() {
    return {
      isVideo: this.$route.query.fristTitle
    }
  },
  watch: {
    $route(to) {
      this.isVideo = to.query.fristTitle
    }
  }
};
</script>
